<template>
	<view class="completed">
	  <topTitle :title="title ? title : $t('completed.defaultTitle')" :isBack="false">
		<template #right>
		  <view @click="goBack(1)">{{ $t('completed.complete') }}</view>
		</template>
	  </topTitle>
	  <view class="com">
		<view>
		  <image src="@/static/image/63.png" mode="widthFix" />
		</view>
  
		<view v-if="type === 'quantification'">
		  <view class="title">{{ $t('completed.quantification.title', { income: income || 0 }) }}</view>
		  <view class="text">{{ $t('completed.quantification.text') }}</view>
		  <view class="btn" @click="goReLaunch('/pages/quantification/index')">
			{{ $t('completed.quantification.button') }}
		  </view>
		</view>
		<view v-else-if="type === 'intelligentInvestment'">
		  <view class="title">{{ $t('completed.intelligentInvestment.title') }}</view>
		  <view class="text">{{ $t('completed.intelligentInvestment.text') }}</view>
		  <view class="btn" @click="goReLaunch('/pages/invest/index')">
			{{ $t('completed.intelligentInvestment.button') }}
		  </view>
		</view>
		<view v-else-if="type === 'transfer'">
		  <view class="title">{{ title }}</view>
		  <view class="text">{{ $t('completed.transfer.text') }}</view>
		  <view class="btn" @click="goBack(1)">{{ $t('completed.transfer.button1') }}</view>
		  <view class="btn goHome" @click="goReLaunch('/pages/index/index')">
			{{ $t('completed.transfer.button2') }}
		  </view>
		</view>
		<view v-else>
		  <view class="title">{{ $t('completed.defaultTitle') }}</view>
		  <view class="text" v-if="type === 'recharge'" v-html="$t('completed.recharge.text')"></view>
		  <view class="text" v-if="type === 'withdrawal'">{{ $t('completed.withdrawal.text') }}</view>
		  <view class="btn" @click="goReLaunch('/pages/index/index')">
			{{ $t('completed.withdrawal.button') }}
		  </view>
		</view>
	  </view>
	</view>
  </template>
<script setup lang="ts">
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
let type = ref<string>()
let title = ref<string>()
let income = ref<string>()

onLoad((options: any) => {
	type.value = options.type
	if( options.title){
		title.value = options.title
	}
	if( options.income){
		income.value = options.income
	}
});
</script>
<style scoped lang="scss">
@import "../../static/scss/index.scss";
</style>